#define __display_c

#include    "includeAll.h"

code const uint8_t displayFonts[10] =
{
    0x3f,  /*0*/
    0x06,  /*1*/
    0x5b,  /*2*/
    0x4f,  /*3*/
    0x66,  /*4*/
    0x6d,  /*5*/
    0x7d,  /*6*/
    0x07,  /*7*/
    0x7f,  /*8*/
    0x6f,  /*9*/
};

void DisplayScan(void)
{

    displayBuffer[0]   =0x00  ;
    displayBuffer[1]   =0x00  ;
    displayBuffer[2]   =0x00  ;
    displayBuffer[3]   =0x00  ;
    displayBuffer[4]   =0x00  ;
    displayBuffer[5]   =0x00  ;
    displayBuffer[6]   =0x00  ;
    displayBuffer[7]   =0x00  ;
    displayBuffer[8]   =0x00  ;
    displayBuffer[9]   =0x00  ;
    displayBuffer[10]  =0x00  ;
    displayBuffer[11]  =0x00  ;
    displayBuffer[12]  =0x00  ;
    displayBuffer[13]  =0x00  ;
    displayBuffer[14]  =0x00  ;
    displayBuffer[15]  =0x00  ;
    displayBuffer[16]  =0x00  ;
    displayBuffer[17]  =0x00  ;
    displayBuffer[18]  =0x00  ;
    displayBuffer[19]  =0x00  ;
    displayBuffer[20]  =0x00  ;
    displayBuffer[21]  =0x00  ;


    setNeiDanWenDu;
    setWenDuTu;
    d_seg=displayFonts[curTemp/10];
    if(f_seg_a)  { setCurTempHA;  }
    if(f_seg_b) {	setCurTempHB; }
    if(f_seg_c)  {setCurTempHC;   }
    if(f_seg_d)  { setCurTempHD;  }
    if(f_seg_e)  { setCurTempHE;  }
    if(f_seg_f)  { setCurTempHF;  }
    if(f_seg_g)  { setCurTempHG;  }

    d_seg=displayFonts[curTemp%10];
    if(f_seg_a) {	 setCurTempLA; }
    if(f_seg_b) {	 setCurTempLB; }
    if(f_seg_c) { setCurTempLC;    }
    if(f_seg_d) { setCurTempLD;    }
    if(f_seg_e) { setCurTempLE;    }
    if(f_seg_f) { setCurTempLF;    }
    if(f_seg_g) { setCurTempLG;    }

    setSheZhiWenDu;
    d_seg=displayFonts[setCurTemp/10];
    if(f_seg_a)    set18a;
    if(f_seg_b)    set18b;
    if(f_seg_c)    set18c;
    if(f_seg_d)    set18d;
    if(f_seg_e)    set18e;
    if(f_seg_f)    set18f;
    if(f_seg_g)    set18g;

    d_seg=displayFonts[setCurTemp%10];
    if(f_seg_a)    set19a;
    if(f_seg_b)    set19b;
    if(f_seg_c)    set19c;
    if(f_seg_d)    set19d;
    if(f_seg_e)    set19e;
    if(f_seg_f)    set19f;
    if(f_seg_g)    set19g;


	if(moShiNum!=2)
	{
		
	
	if(bSuReOrJieNeng)
	{
		setJieNengMoShi;
		setBanDanSuRe;
		if(bSecFlash500ms)
		{
			setZhengDanJiaRe;
			setZengRong;
		}
		
	}
	else
	{
		setZhengDanJiaRe;
			setZengRong;
		if(bSecFlash500ms)
		{
			setJieNengMoShi;
		setBanDanSuRe;
		}
		
	}
	}
	else
	{
		if(bSuReOrJieNeng)
		{
		
		if(bSecFlash500ms)
		{
			setZhengDanJiaRe;
			setZengRong;
		}
		
	}
	else
	{
		
		if(bSecFlash500ms)
		{
			setJieNengMoShi;
		setBanDanSuRe;
		}
		
	}
	}
	
	
    switch(yuYueNum)
    {
    case 0:
    case 1:
    case 2:
  
        clockHour=mainClockHour;
        clockMin =mainClockMin;
		setShiZhong;
        break;
    case 3:
    case 4:
        clockHour = orderClockOpenHour;
        clockMin =  orderClockOpenMin;
        setDingShiKai;
        break;
    case 5:
    case 6:
        clockHour	=orderClockCloseHour;
        clockMin 	=orderClockCloseMin;
        setDingShiGuan;
        break;
    }
	
	

    d_seg=displayFonts[clockHour/10];
    if(f_seg_a)    set11a;
    if(f_seg_b)    set11b;
    if(f_seg_c)    set11c;
    if(f_seg_d)    set11d;
    if(f_seg_e)    set11e;
    if(f_seg_f)    set11f;
    if(f_seg_g)    set11g;

    d_seg=displayFonts[clockHour%10];
    if(f_seg_a)    set12a;
    if(f_seg_b)    set12b;
    if(f_seg_c)    set12c;
    if(f_seg_d)    set12d;
    if(f_seg_e)    set12e;
    if(f_seg_f)    set12f;
    if(f_seg_g)    set12g;


    d_seg=displayFonts[clockMin/10];
    if(f_seg_a)    set13a;
    if(f_seg_b)    set13b;
    if(f_seg_c)    set13c;
    if(f_seg_d)    set13d;
    if(f_seg_e)    set13e;
    if(f_seg_f)    set13f;
    if(f_seg_g)    set13g;

    d_seg=displayFonts[clockMin%10];
    if(f_seg_a)    set14a;
    if(f_seg_b)    set14b;
    if(f_seg_c)    set14c;
    if(f_seg_d)    set14d;
    if(f_seg_e)    set14e;
    if(f_seg_f)    set14f;
    if(f_seg_g)    set14g;

	if(moShiNum==3)
	{
		displayBuffer[10]=0x00;
		displayBuffer[11]=0x00;
		displayBuffer[12]=0x00;
		displayBuffer[13]=0x00;
		setFengGuYeDian;
		if(bFengGuYeDian)
		{
			setFGYDOn;
		}
		else
		{
			setFGYDOff;
		}
	}
	else
	{
		if(bSecFlash500ms)
		{
			setShiZhongTu;
		}
	}
	
	if(bFengGuYeDian)
	{
		setFengGuYeDian;
	}
	
			if(curTemp<35)
			{
				reShuiLiang=10;
			}
		    if(curTemp>=35)
			{
				reShuiLiang=20;
			}
			if(curTemp>=40)
			{
				reShuiLiang=30;
			}
			if(curTemp>=45)
			{
				reShuiLiang=40;
			}
			if(curTemp>=50)
			{
				reShuiLiang=50;
			}
			if(curTemp>=55)
			{
				reShuiLiang=60;
			}
			if(curTemp>=60)
			{
				reShuiLiang=70;
			}
			if(curTemp>=65)
			{
				reShuiLiang=80;
			}
			if(curTemp>=70)
			{
				reShuiLiang=99;
			}
			setReShuiLiang;
			setBaiFenBi;
		 d_seg=displayFonts[reShuiLiang/10];
    if(f_seg_a)    set15a;
    if(f_seg_b)    set15b;
    if(f_seg_c)    set15c;
    if(f_seg_d)    set15d;
    if(f_seg_e)    set15e;
    if(f_seg_f)    set15f;
    if(f_seg_g)    set15g;

    d_seg=displayFonts[reShuiLiang%10];
    if(f_seg_a)    set17a;
    if(f_seg_b)    set17b;
    if(f_seg_c)    set17c;
    if(f_seg_d)    set17d;
    if(f_seg_e)    set17e;
    if(f_seg_f)    set17f;
    if(f_seg_g)    set17g;	

	
	
    	if((bSaveTemp==0)&&(bOrderOpen==0)&&(bPowerOnOff)&&(bDuanDian==0))
        {
			if(bSecFlash500ms)
			{
				 setJiaRe;
			}
           
			  setBaoWen;
			if(bSecFlash500ms)
			{
				DengDai();
			}
        }
        else
        {
			 setJiaRe;
			if(bSecFlash500ms)
			{
				setBaoWen;
			}
            
			DengDai();
        } 
		
		if((flashYuYue<=0)&&(bFengGuYeDian==0))
		{
			if(bOrderOpen)
			{
				setDingShiKai;
			}
			else if(bOrderClose)
			{
				setDingShiGuan;
			}
		}
}




void DengDai()
{

		if(curTemp<50)
			{
					setBulueQuan;
			}
			else if((curTemp<60)&&(curTemp>=50))
			{
					setBulueQuan;
					setRedQuan;
			}
			else if((curTemp>=60)&&(curTemp<=90))
			{
					setRedQuan;
			}

}
